<?php
// +----------------------------------------------------------------------
// | 麦沃德科技赋能开发者，助力中小企业发展
// +----------------------------------------------------------------------
// | Copyright (c) 2017～2024  www.wdadmin.cn    All rights reserved.
// +----------------------------------------------------------------------
// | Wdadmin系统产品软件并不是自由软件，不加密，并不代表开源，未经许可不可自由转售和商用
// +----------------------------------------------------------------------
// | Author: MY WORLD Team <bd@maiwd.cn>   www.wdadmin.cn
// +----------------------------------------------------------------------

/**
 * Class Bank
 * Desc  银行卡Model
 * Create on 2024/10/26 9:39
 * Create by wangyafang
 */
namespace app\api\model\wddj;

use app\api\model\wddj\driver\Driver;
use think\Model;

class Bank extends Model
{
// 表名
    protected $name = 'wddj_bank';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    protected static function init()
    {
        self::beforeInsert(function ($row) {
            $row->driver_id = (new Driver())->where('wechat_id',$row['wechat_id'])->value('id');
        });
    }
}



 